import os
from kamene.all import srp, Ether, ARP


class IpGain(object):
    def get_ip_one(self):
        """获取一个ip地址的详情信息"""
        ip_scan = '192.168.9.1/24'
        try:
            ans, unans = srp(Ether(dst="ff:ff:ff:ff:ff:ff") / ARP(pdst=ip_scan), timeout=2)
        except Exception as Error:
            print(Error)
        else:
            print(ans)


if __name__ == '__main__':
    a = IpGain()
    a.get_ip_one()
